home *** CD-ROM | disk | FTP | other *** search
- // Copyright 1992 by Jon Dart. All Rights Reserved.
-
- #ifndef _SCORING_H
- #define _SCORING_H
-
- #include "board.h"
-
- class Scoring
- {
- // This class does static evaluation of chess positions.
-
- public:
-
- struct Scores
- {
- int center;
- int development;
- int castling;
- int pawn_structure;
- int king_safety;
- int threats;
- int endgame;
- };
-
- static int evalu8( const Board &board );
- // evaluates "board" from the perspective of the side to move.
-
- static int positional_score( const Board &board );
- // returns a positional score
-
- static int positional_score( const Board &board, Scores &scores,
- Scores &opp_scores);
- // returns a positional score, with a breakdown of the components.
- // "scores" are the scores for the side to move; "opp_scores"
- // for the opposing side.
-
- static int material_score( const Board &board );
- // returns a material score
-
- static int threat_score( const Board &board, const ColorType side );
- // returns a score indicating severity of threats against the
- // side to move.
-
- static Boolean check_en_prise( const Board &board, const Square sq,
- const Piece p);
- // return "True" if a piece p is unsafe on square "sq".
-
- static Boolean pawn_threats;
- // set by calls to positional_score or evalu8; true if
- // any pieces threatened by pawns.
-
- static int en_prise;
- // set by calls to positional_score or evalu8; count of
- // apparently en prise pieces
-
- static int trapped;
- // set by calls to positional_score or evalu8; true if
- // any piece appears trapped.
-
- };
-
- #endif
-